using Cinemachine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class OnDesktop : MonoBehaviour
{
    public GameObject camera;

    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.CompareTag("Player"))
        {
            camera.GetComponent<CinemachineBrain>().enabled = false;
            camera.transform.position = new Vector3(0, 0, -10);
        }
    }
    private void OnTriggerExit2D(Collider2D collision)
    {
        if (collision.CompareTag("Player"))
        {
            if (!camera.GetComponent<CinemachineBrain>().enabled)
            {
                camera.GetComponent<CinemachineBrain>().enabled = true;
            }
        }
    }
}
